package com.myapi.ModelPoker;
import java.util.*;

import com.myapi.client.DAO.PlayerDAO;

/**
 * 
 * @author Realease by Yoan Olivier 
 *
 */
public class TournamentGame extends PokerGame {
	private ArrayList<Table> tables;
	
//	protected TournamentGame(int numTables) {
//		tables = new ArrayList<Table>(numTables);
//		for(int i = 0; i < numTables; i++) {
//			Table table = new Table(String.valueOf(i));
//			tables.add(table);
//		}
//	}
		
	
	public void initGame() {
		
	}
	
	public void startGame() {
		
	}
	
	//TODO: check if this returns null
	public Table getTable(String tableId) {
		for(int i = 0; i < tables.size(); i++) {
			Table tempTable = tables.get(i);
			if(tempTable.getId().equals(tableId)) {
				return tempTable;
			}
		}
		return null;
	}
	
	public void addTable(Table table) {
		tables.add(table);		
	}
	
	public void removeTable(Table table) {
		if(tables.indexOf(table)!=-1){
			tables.remove(table);
		}
		System.out.println("Table doesn't exist");
	}




	@Override
	public boolean addPlayer(String name, String id, double cash) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean removePlayer(String id) {
		// TODO Auto-generated method stub
		return false;
	}

}
